package 二维数组;

import java.util.Arrays;

public class 遍历 {
    public static void main(String[] args) {
        int[][] array1 = {{1,2,3},{4,5,6}};
        for (int i = 0; i < 2; i++) {
            for (int j = 0; j < 3; j++) {
                System.out.print(array1[i][j] + " ");
            }
            System.out.println();
        }


        System.out.println(array1);
//        System.out.println(array1[0]);
//        System.out.println(array1[1]);
        System.out.println(array1.length);//2
        System.out.println(array1[1].length);//3
//        System.out.println("==================");
        System.out.println(Arrays.toString(array1[0]));//1 2 3
        System.out.println(Arrays.toString(array1[1]));//4 5 6
//

        for (int i = 0; i < array1.length; i++) {
            for (int j = 0; j < array1[i].length; j++) {
                System.out.print(array1[i][j] + " ");
            }
            System.out.println();
        }
    }
}
